from selenium import webdriver
from selenium.webdriver.common.by import By

d = webdriver.Chrome()
d.maximize_window()
d.get("https://www.baidu.com/")
"""
    八大定位：
    ID = "id"
    XPATH = "xpath"
    LINK_TEXT = "link text"
    PARTIAL_LINK_TEXT = "partial link text"
    NAME = "name"
    TAG_NAME = "tag name"
    CLASS_NAME = "class name"
    CSS_SELECTOR = "css selector"
"""
# d.find_element(By.ID, '')# 元素id  ok
# d.find_element(By.CLASS_NAME, '') #元素classname   ok
# d.find_element(By.NAME,'') #元素name  元素name属性值 ok
# d.find_element(By.TAG_NAME,'') #元素标签，比如span ，p
# d.find_element(By.XPATH,'')# 元素xpath
# d.find_element(By.CSS_SELECTOR,'') #元素css选择器
# d.find_element(By.LINK_TEXT)#
# d.find_element(By.PARTIAL_LINK_TEXT,'')#

"""
2.要熟练八大定位，这是自动化的基础
ByType = Literal["id", "xpath", "link text", "partial link text", "name", "tag name", "class name", "css selector"]
"""

ele=d.find_element(By.ID,'#kw')
"""
click事件
"""

d.f

